package translated;

import java.util.List;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.jet.util.*;

public class TreeEditPartGen
{
  protected static String nl;
  public static synchronized TreeEditPartGen create(String lineSeparator)
  {
    nl = lineSeparator;
    TreeEditPartGen result = new TreeEditPartGen();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "/**" + NL + " * Copyright (c) Software Institute of PKU" + NL + " * All rights reserved. " + NL + " * This program and the accompanying materials" + NL + " * are made available under the terms of the Eclipse Public License v1.0" + NL + " * which accompanies this distribution, and is available at" + NL + " * http://www.eclipse.org/legal/epl-v10.html" + NL + " *" + NL + " */" + NL + "package ";
  protected final String TEXT_2 = ";" + NL + "" + NL + "" + NL + "" + NL + "import java.beans.PropertyChangeEvent;" + NL + "import java.util.ArrayList;" + NL + "import java.util.List;" + NL + "" + NL + "import org.eclipse.swt.graphics.Image;" + NL + "" + NL + "import edu.pku.sei.modeler.images.ImageProvider;" + NL + "import edu.pku.sei.modeler.edit.parts.BaseTreeEditPart;" + NL + "import edu.pku.sei.modeler.model.structure.MetaNode;" + NL + "import edu.pku.sei.modeler.model.structure.MetaShapeElement;" + NL + "" + NL + "import ";
  protected final String TEXT_3 = ".";
  protected final String TEXT_4 = ";" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " *" + NL + " */" + NL + "public class ";
  protected final String TEXT_5 = "TreeEditpart extends BaseTreeEditPart {" + NL + "    public ";
  protected final String TEXT_6 = "TreeEditpart(MetaShapeElement model) {" + NL + "        super(model);" + NL + "    }" + NL + "" + NL + "    protected void handlePropertyChanged(PropertyChangeEvent event) {" + NL + "\t\tString propertyName = event.getPropertyName();" + NL + "\t}" + NL + "    " + NL + "    private ";
  protected final String TEXT_7 = " get";
  protected final String TEXT_8 = "() {" + NL + "\t\treturn (";
  protected final String TEXT_9 = ")((MetaNode)getModel()).getModelElement();" + NL + "\t}" + NL + "" + NL + "    protected void refreshVisuals() {" + NL + "    \tsuper.refreshVisuals();" + NL + "    \tImage image = ImageProvider.getImage(ImageProvider.CLASS_IMAGE);" + NL + "    \tsetWidgetImage(image);" + NL + "        setWidgetText(get";
  protected final String TEXT_10 = "().toString());" + NL + "    }" + NL + "}";

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
     MetaClass cls = (MetaClass) argument; 
    stringBuffer.append(TEXT_1);
    stringBuffer.append(ModelerConstants.pkgBase + "." + ModelerConstants.editpartBase);
    stringBuffer.append(TEXT_2);
    stringBuffer.append(PackageRetriever.retrievePackage(cls));
    stringBuffer.append(TEXT_3);
    stringBuffer.append(cls.getName());
    stringBuffer.append(TEXT_4);
    stringBuffer.append(cls.getName());
    stringBuffer.append(TEXT_5);
    stringBuffer.append(cls.getName());
    stringBuffer.append(TEXT_6);
    stringBuffer.append(cls.getName());
    stringBuffer.append(TEXT_7);
    stringBuffer.append(cls.getName());
    stringBuffer.append(TEXT_8);
    stringBuffer.append(cls.getName());
    stringBuffer.append(TEXT_9);
    stringBuffer.append(cls.getName());
    stringBuffer.append(TEXT_10);
    return stringBuffer.toString();
  }
}
